package com.xbk.seckill.stock.domain.model.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 商品库存扣减与恢复数据
 *
 * @author xiexu
 * @date 2025/3/8 21:30
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SeckillStockBucketDeduction implements Serializable {

    private static final long serialVersionUID = -6298907463471862983L;

    /**
     * 商品id
     */
    private Long goodsId;

    /**
     * 商品数量
     */
    private Integer quantity;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 分桶编号
     */
    private Integer serialNo;

    public boolean isEmpty() {
        return this.goodsId == null
                || this.quantity == null
                || this.userId == null
                || this.serialNo == null;
    }

}
